home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1075 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.8 KB

  1. From: gregor@netcom.com (Greg Colvin)
  2. Message-ID: <gregorDpsBEt.Dw0@netcom.com>
  3. X-Original-Date: Sat, 13 Apr 1996 05:04:05 GMT
  4. Path: in1.uu.net!bounce-back
  5. Date: 14 Apr 96 12:30:24 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: Use of standard exception classes
  9. Organization: Netcom Online Communications Services (408-241-9760 login: guest)
  10. References: <9604121530.AA08606@sun132.spd.dsccc.com>
  11. Apparently-To: comp-std-c++@uunet.uu.net
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBFAgUBMXDv/eEDnX0m9pzZAQETIQGAjLWxTbIlC+hHuqQ0Kdc6E0a9h2Ed4IOs
  14.     DmWBoQB1zFgRgRZxx+Q7LFXn/JpFY/Xx
  15.     =tidc
  16.  
  17. In article <9604121530.AA08606@sun132.spd.dsccc.com>
  18. kcline@spdmail.spd.dsccc.com (Kevin Cline) writes:
  19.  
  20. >In "The Standard C++ Library" on page 65, Plauger wrote:
  21. >
  22. >  "I strongly encourage you to follow the lead of the Standard C++
  23. >   library in the use of exceptions:
  24. >   * Throw only objects of one or more classes derived from [exception]
  25. >
  26.  
  27. Good advice.
  28.  
  29. >Page 19-1 of the 4/95 version of the draft says "The Standard C++
  30. >library provides classes to be used to report errors in C++ programs."
  31. >
  32.  
  33. True.
  34.  
  35. >But in section 19.1.1 of the same draft it says:
  36. >
  37. >"The class exception defines the base class for the  types  of  objects
  38. > thrown  as  exceptions by *C++ Standard library components*, and certain
  39. > expressions, to report errors detected during program execution."
  40. >
  41.  
  42. Also true.
  43.  
  44. >Can someone on the committee indicate whether it was the committee's
  45. >intention for the standard exception class hierarchy to be used in
  46. >general C++ programming, or whether the intention was for the standard
  47. >exception class hierarchy to be reserved to the Standard C++ library?
  48. >
  49.  
  50. The intention was for the exception class hierarchy to serve well as
  51. a basis for your own exception classes and as all the concrete exception
  52. classes the library itself needs.  You can derive from exception, which is
  53. almost an abstract class, or you can derive from its derivatives.
  54.  
  55. >Another developer on our team has asked
  56. >  How can we be sure that ANSI C++ library callbacks work
  57. >  correctly in the face of exceptions?  What if ANSI C++
  58. >  library code catches *our* exception?
  59. >
  60.  
  61. Not to worry.
  62.  
  63. >Is this a problem, or are library functions required to reraise any
  64. >exceptions thrown by client code? 
  65. >
  66.  
  67. Client exceptions are intended to be pass through library code uncaught, or
  68. at least reraised.
  69.  
  70. Greg Colvin
  71. gregor@netcom.com
  72. ---
  73. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  74. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  75. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  76. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  77. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  78.